keep diff
drop if diff == .
set obs 28
gen hodges = .
sort diff
gen pair= _n

sum diff if pair == 1
local one = r(mean)
sum diff if pair == 2
local two = r(mean)
sum diff if pair == 3
local three = r(mean)
sum diff if pair == 4
local four = r(mean)
sum diff if pair == 5
local five = r(mean)
sum diff if pair == 6
local six = r(mean)
sum diff if pair == 7
local seven = r(mean)

replace hodges = (`one'+`one')/2 in 1
replace hodges = (`one'+`two')/2 in 2
replace hodges = (`one'+`three')/2 in 3
replace hodges = (`one'+`four')/2 in 4
replace hodges = (`one'+`five')/2 in 5
replace hodges = (`one'+`six')/2 in 6
replace hodges = (`one'+`seven')/2 in 7

replace hodges = (`two'+`two')/2 in 8
replace hodges = (`two'+`three')/2 in 9
replace hodges = (`two'+`four')/2 in 10
replace hodges = (`two'+`five')/2 in 11
replace hodges = (`two'+`six')/2 in 12
replace hodges = (`two'+`seven')/2 in 13

replace hodges = (`three'+`three')/2 in 14
replace hodges = (`three'+`four')/2 in 15
replace hodges = (`three'+`five')/2 in 16
replace hodges = (`three'+`six')/2 in 17
replace hodges = (`three'+`seven')/2 in 18


replace hodges = (`four'+`four')/2 in 19
replace hodges = (`four'+`five')/2 in 20
replace hodges = (`four'+`six')/2 in 21
replace hodges = (`four'+`seven')/2 in 22


replace hodges = (`five'+`five')/2 in 23
replace hodges = (`five'+`six')/2 in 24
replace hodges = (`five'+`seven')/2 in 25


replace hodges = (`six'+`six')/2 in 26
replace hodges = (`six'+`seven')/2 in 27

replace hodges = (`seven'+`seven')/2 in 28

sum hodges, detail
local hodges_lehman = r(p50) 
noi di `hodges_lehman'

drop diff pair
